Implementing and Analysing Union-Find in CHR

نویسندگان

  • Tom Schrijvers
  • Thom Frühwirth
چکیده

CHR is a committed-choice rule-based language that was originally intended for writing constraint solvers. In this paper we show that it is also possible to write the classic union-find algorithm and variants in CHR. The programs neither compromise in declarativeness nor efficiency. Using CHR analysis techniques we study logical correctness, confluence and time complexity of our programs. We observe the essential destructive update of the algorithm. We can match the time complexity of the best known imperative implementations with the help of hashtable indexes. We illustrate the fact with experimental results. Implementing and Analysing Union-Find in CHR Tom Schrijvers and Thom Frühwirth 1 Department of Computer Science, K.U.Leuven, Belgium www.cs.kuleuven.ac.be/ ̃toms/ 2 Faculty of Computer Science, University of Ulm, Germany www.informatik.uni-ulm.de/pm/mitarbeiter/fruehwirth/ Abstract. CHR is a committed-choice rule-based language that was originally intended for writing constraint solvers. In this paper we show that it is also possible to write the classic union-find algorithm and variants in CHR. The programs neither compromise in declarativeness nor efficiency. Using CHR analysis techniques we study logical correctness, confluence and time complexity of our programs. We observe the essential destructive update of the algorithm. We can match the time complexity of the best known imperative implementations with the help of hashtable indexes. We illustrate the fact with experimental results. CHR is a committed-choice rule-based language that was originally intended for writing constraint solvers. In this paper we show that it is also possible to write the classic union-find algorithm and variants in CHR. The programs neither compromise in declarativeness nor efficiency. Using CHR analysis techniques we study logical correctness, confluence and time complexity of our programs. We observe the essential destructive update of the algorithm. We can match the time complexity of the best known imperative implementations with the help of hashtable indexes. We illustrate the fact with experimental results.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Analysing the CHR Implementation of Union-Find

CHR (Constraint Handling Rules) is a committed-choice rulebased language that was originally intended for writing constraint solvers. Over time, CHR is used more and more as a general-purpose programming language. In companion paper [12] we show that it is possible to write the classic union-find algorithm and variants in CHR with bestknown time complexity, which is believed impossible in Prolo...

متن کامل

Parallelizing Union-Find in Constraint Handling Rules Using Confluence Analysis

Constraint Handling Rules is a logical concurrent committedchoice rule-based language. Recently it was shown that the classical union-find algorithm can be implemented in CHR with optimal time complexity. Here we investigate if a parallel implementation of this algorithm is also possible in CHR. The problem is hard for several reasons: Up to now, no parallel computation model for CHR was define...

متن کامل

Analysing the Effect of Financial Development and Symmetric Information on Economic Growth of European Union Members

The relationship between financial development and economic growth is the crucial issues which could grab economists and policy makers' attention to it. Financial market plays an essential role on each economy, because it conducts funds to those individuals or firms which have productive investment opportunities. If the financial system does not perform this role efficiently, the economic effic...

متن کامل

Deriving Quasi-Linear-Time Algorithms from Union-Find in CHR Extended Abstract

The union-find algorithm can be seen as solving simple equations between variables or constants. With a few lines of code change, we generalise its implementation in CHR from equality to arbitrary binary relations. By choosing the appropriate relations, we can derive fast algorithms for solving certain propositional logic (SAT) problems as well as certain polynomial equations in two variables. ...

متن کامل

Quasi-Linear-Time Algorithms by Generalisation of Union-Find in CHR

The union-find algorithm can be seen as solving simple equations between variables or constants. With a few lines of code change, we generalise its implementation in CHR from equality to arbitrary binary relations. By choosing the appropriate relations, we can derive fast incremental algorithms for solving certain propositional logic (SAT) problems and polynomial equations in two variables. In ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004